﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Login.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Full Maintenance</title>
    <style type="text/css" >
        .style1
        {
            width: 30%;
            height: 58px;
        }
        .style2
        {
            height: 28px;
        }
        .style8
        {
            text-align: center;
        }
        .style13
        {
            text-align: left;
        }
        #Button1
        {
            height: 26px;
            width: 64px;
        }
        .style15
        {
            height: 23px;
        }
        #header
        {
            padding: 0px; 
        	margin: 0px; 
        	 
        	height: 130px;
        	text-align :center;
        	display: block;
        }
        .style19
        {
            height: 28px;
            width: 73px;
            text-align: right;
        }
        .style20
        {
            height: 23px;
            width: 73px;
        }
        </style>
    

</head>
<body text="Djavier">
    <form id="form1" runat="server">
    
    <div>
    <img id="header" src="Images/header.jpg" alt="he" />
    
    </div>
    <br />
    
        <table class="style1" align="center" rules="none" frame="void" 
        style="border-color: #FF6666; top:20%;" >
            <tr>
                <td class="style19">
                    User</td>
                <td class="style2">
                    <input id="txtUser" runat ="server" type="text" />
                   
                    </td>
            </tr>
            <tr>
                <td class="style20">
                    &nbsp;Password</td>
                <td class="style15">
                    <input id="txtPassword" runat ="server"  type="password" value="D1234567!" /></td>
            </tr>
            <tr>
                <td class="style13" colspan="2">
                        
                       
                         &nbsp;</td>
            </tr>
            <tr>
                <td class="style8" colspan="2">
                    &nbsp;&nbsp; <input id="Button1" type="button" value="LOGIN" 
                            onclick="DoPostBack('button1','login')" /></td>
            </tr>
        </table>
    
    </form>
    
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
</body>
</html>

    
  <script language="javascript" type="text/javascript">
function DoPostBack (target,arg)
{
var validador = validarPass();
if (validador == true){
 __doPostBack(target,arg);
 }
}

function validarPass()
{
var flag = true;
var cont = 0;
var pass = document.getElementById("txtPassword").value;

if (pass.length==0)
{
alert("No deje el campo vacio");
document.getElementById("txtPassword").value = "";
return false;
} 

if ((pass.length>0) && (pass.length<8))
{
alert("Caracteres Minimo son 8");
document.getElementById("txtPassword").value = "";
return false;
} 


while (flag && cont < pass.length)
{
 if (pass.charAt(cont)==" " )
     {
     flag = false;
     }
 cont++;
 
}

if (!flag)
    {
    alert("no puede contener vacios");
    document.getElementById("txtPassword").value = "";
    return false;
    } 

if (flag)
    {
    return true;
    } 

}


//cont =0;

//while (flag && cont < pass.length)
//{
// if (pass.charAt(cont)==  )
//     {
//     flag = false;
//     }
// cont++;
// 
//}



</script>


